package yecq_blockqueue;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

public class Main {

    public static void main(String[] args) {
        BlockingQueue<String> buffer = new ArrayBlockingQueue(10);
        // 开启 生产者、消费者 两个类
        for (int i = 1; i <= 6; i++) {
            new Producer("Producer-" + i, buffer).start();
        }
        for (int i = 1; i <= 5; i++) {
            new Consumer("Consumer-" + i, buffer).start();
        }
    }
}
